/**
 * Copyright(c) 2013-2016 by Puhuifinance Inc.
 * All Rights Reserved
 */
package com.puhui.chome.manager;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.puhui.chome.dao.MonitorCcDao;
import com.puhui.chome.model.MonitorCc;

/**
 * @author dingxingang
 */
@Component
public class MonitorCcManager {

	@Autowired
	private MonitorCcDao monitorCcDao;

	/**
	 * 查询某监控项抄送列表
	 * 
	 * @param itemId
	 * @return
	 */
	public List<MonitorCc> findMonitorCcByItemId(Long itemId) {
		Map<String, Object> param = new HashMap<>();
		param.put("itemId", itemId);
		return monitorCcDao.findMonitorCc(param);
	}

	/**
	 * 添加
	 * 
	 * @author dingxingang
	 * @param monitorCc
	 */
	public void addMonitorCc(MonitorCc monitorCc) {
		monitorCc.setCreateTime(new Date());
		monitorCc.setUpdateTime(new Date());
		monitorCcDao.addMonitorCc(monitorCc);
	}

	/**
	 * 根据ID获取信息
	 * 
	 * @author dingxingang
	 * @param id
	 * @return
	 */
	public MonitorCc getMonitorCcById(Long id) {
		return monitorCcDao.getMonitorCcById(id);
	}

	/**
	 * 获取总记录数
	 * 
	 * @author dingxingang
	 * @param param
	 * @return
	 */
	public long findMonitorCcCount(Map<String, Object> param) {
		return monitorCcDao.findMonitorCcCount(param);
	}

	/**
	 * 查询列表
	 * 
	 * @author dingxingang
	 * @param param
	 * @return
	 */
	public List<MonitorCc> findMonitorCc(Map<String, Object> param) {
		return monitorCcDao.findMonitorCc(param);
	}

	/**
	 * 修改
	 * 
	 * @param monitorCc
	 */
	public void updateMonitorCc(MonitorCc monitorCc) {
		monitorCcDao.updateMonitorCc(monitorCc);
	}

	/**
	 * 删除
	 * 
	 * @param id
	 */
	public void deleteMonitorCc(Long id) {
		monitorCcDao.deleteMonitorCc(id);
	}

}
